package com.ticket.sass.admin.dto.output.order;

import com.ticket.sass.common.entity.tenant.TakeTicketEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author ywb
 * @date 2022-03-29 11:36
 */
@Data
@ApiModel(value = "票信息详情")
public class TakeTicketOutPut {
    private Long id;
    
    @ApiModelProperty(value = "二维码")
    private String qrCode;
    
    @ApiModelProperty(value = "检票时间")
    private LocalDateTime checkedAt;
    
    @ApiModelProperty(value = "票号")
    private String ticketCode;
    
    @ApiModelProperty(value = "座位编码")
    private String seatCode;
    
    @ApiModelProperty(value = "座位号")
    private String seat;
    
    @ApiModelProperty(value = "票状态：0 未检票，1 已检票")
    private Short status;
    
  
    public static TakeTicketOutPut toOutput(TakeTicketEntity entity){
        TakeTicketOutPut outPut = new TakeTicketOutPut();
        outPut.id = entity.getId();
        outPut.qrCode = entity.getQrCode();
        outPut.checkedAt = entity.getCheckedAt();
        outPut.ticketCode = entity.getTicketCode();
        outPut.seatCode = entity.getSeatCode();
        outPut.seat = entity.getSeat();
        outPut.status = entity.getStatus().getValue();
        return outPut;
    }
}
